package com.nnnu.orange.pojo.entity;

import java.io.Serial;
import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;

import java.time.LocalDateTime;
import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonIgnore;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;

/**
 * <p>
 * 存储图书评论的详细信息
 * </p>
 *
 * @author zk
 * @since 2024-11-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("comments")
@ApiModel(value = "Comments对象", description = "存储图书评论的详细信息")
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class Comments implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "评论唯一标识")
    @TableId(value = "comment_id", type = IdType.AUTO)
    private Integer commentId;
    @ApiModelProperty(value = "用户ID（关联users表）")
    private Integer userId;


    @ApiModelProperty(value = "图书ID（关联books表）")
    private Integer bookId;

    @ApiModelProperty(value = "评分")
    private BigDecimal rating;

    @ApiModelProperty(value = "评论内容")
    private String comment;

    @ApiModelProperty(value = "点赞数")
    private Integer likes;

    @ApiModelProperty(value = "点踩数")
    private Integer dislikes;

    @ApiModelProperty(value = "是否匿名")
    private Boolean isAnonymous;

    @ApiModelProperty(value = "评论时间")
    private LocalDateTime createdAt;

    @ApiModelProperty(value = "评论状态：0=待审核, 1=已审核, 2=已删除")
    private Integer status;


    @ApiModelProperty(value = "是否置顶：0=否, 1=是")
    private Integer isTop;

    @ApiModelProperty(value = "管理员id")
    @JsonIgnore
    private Integer adminId;
}
